import request from '@/utils/http'

// 运动信息
// 获取运动记录
export function getSportRecord(data: any) {
  return request.get({
    url: `/api/sp/pat/daily/task/getSportRecord`,
    data
  })
}

// 各类运动
export function getSportsInfo(data: any) {
  return request.get({
    url: `/api/sp/pat/daily/task/getSportInfo`,
    data
  })
}
// 根据区间获取运动信息
export function getSportsInfoByDate(data: any) {
  return request.get({
    url: `/api/sp/pat/daily/task/getSportRecordByDate`,
    data
  })
}

//保存运动记录
export function saveSportRecord(data: any) {
  return request.post({
    url: `/api/sp/pat/daily/task/saveSportRecord`,
    data
  })
}

// 计算能量
export function calculateEnergy(data: any) {
  return request.post({
    url: `/api/sp/pat/daily/task/calculateEnergy`,
    data
  })
}

// 删除运动
export function del_sports(data: any) {
  return request.get({
    url: `/api/sp/pat/daily/task/delSportRecord?id=${data.id}`
  })
}
//保存健康信息
export const save_new_weight = (params: any) => {
  return request.post({
    url: '/api/signs/info/save',
    data: params
  })
}
